Merge remote-tracking branch 'origin/master' into bootstrap3-tweeks

Andrew Cantino 11 年之前
父節點
當前提交
85b1652e18
共有 2 個文件被更改,包括 7 次插入10 次删除
  1. 3 1
      README.md
  2. 4 9
      lib/capistrano/sync.rb

+ 3 - 1
README.md

@@ -46,13 +46,15 @@ And now, some example screenshots.  Below them are instructions to get you start
46 46
 
47 47
 ### Quick Start
48 48
 
49
-If you just want to play around, you can simply clone this repository, then perform the following steps:
49
+If you just want to play around, you can simply fork this repository, then perform the following steps:
50 50
 
51
+* Run `git remote add upstream https://github.com/cantino/huginn.git` to add the main repository as a remote for your fork.
51 52
 * Copy `.env.example` to `.env` (`cp .env.example .env`) and edit `.env`, at least updating the `APP_SECRET_TOKEN` variable.
52 53
 * Run `rake db:create`, `rake db:migrate`, and then `rake db:seed` to create a development MySQL database with some example Agents.
53 54
 * Run `foreman start`, visit [http://localhost:3000/][localhost], and login with the username of `admin` and the password of `password`.
54 55
 * Setup some Agents!
55 56
 * Read the [wiki][wiki] for usage examples and to get started making new Agents.
57
+* Periodically run `git fetch upstream` and then `git checkout master && git merge upstream/master` to merge in the newest version of Huginn.
56 58
 
57 59
 Note: by default, emails are not sent in the `development` Rails environment, which is what you just setup.  If you'd like to enable emails when playing with Huginn locally, edit `config.action_mailer.perform_deliveries` in `config/environments/development.rb`.
58 60
 

+ 4 - 9
lib/capistrano/sync.rb

@@ -91,25 +91,20 @@ namespace :sync do
91 91
   end
92 92
 
93 93
   # Used by database_config and remote_database_config to parse database configs that depend on .env files.  Depends on the dotenv-rails gem.
94
-  class EnvLoader < Dotenv::Environment
94
+  class EnvLoader
95 95
     def initialize(data)
96
-      @data = data
97
-      load
96
+      @env = Dotenv::Parser.call(data)
98 97
     end
99 98
 
100 99
     def with_loaded_env
101 100
       begin
102 101
         saved_env = ENV.to_hash.dup
103
-        ENV.update(self)
102
+        ENV.update(@env)
104 103
         yield
105 104
       ensure
106 105
         ENV.replace(saved_env)
107 106
       end
108 107
     end
109
-
110
-    def read
111
-      @data.split("\n")
112
-    end
113 108
   end
114 109
 
115 110
   #
@@ -167,4 +162,4 @@ namespace :sync do
167 162
       run "rm #{delete_backups}"
168 163
     end
169 164
   end
170
-end
165
+end